<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定位技术</title>
    <style>
        html{
            font-size:12px;
        }
        .example0{
            width:500px;
            margin:0 auto;
            border:1px solid red;
            overflow: hidden;
        }
        .example1{
            width:500px;
            margin:0 auto;
            border:1px solid blue;
        }
        .div0{
            width:200px;
            height:100px;
            border:1px solid #ccc;
            position: relative;
            background-color:red;
            left:30px;
            top:0px;
            z-index: 3;
        }
        .div1{
            width:300px;
            height:200px;
            position:relative;
            background-color:blue;
            border:1px solid yellow;
            left: 20px;
            top:-40px;
            z-index: 2;
        }
        .div2{
            width:200px;
            height:100px;
            border:1px solid #ccc;
            position:absolute;
            left:30px;
            top:10px;
        }
        .select{
            position: fixed;
            height: 100px;
            width: 100vw;
            left: 0;
            bottom:0;
            border:1px solid #ccc;
            background-color:blue;
            z-index: 9;
        }
        .navigate{
            position: fixed;
            height: 40px;
            width: 100vw;
            left: 0;
            top:0;
            border:1px solid #ccc;
            background-color:green;
            z-index: 10;
        }
    </style>
</head>
<body>
    <nav class="navigate">导航栏</nav>
    <article class="select">选择</article>
    <article class="example0">
        <h1>相对定位，定位点为盒子左上角的点，针对父元素进行定位</h1>
        <div class="div0">test0</div>
        <div class="div1">test1</div>
    </article>
    <article class="example1">
        <h1>绝对定位,定位点为盒子左上角的点，针对视口进行定位</h1>
        <div class="div2">test2</div>
    </article>
</body>
</html>